.TH SYM2ASM 1 "April 2009" "" "Test Dept."
.SH NAME
sym2asm \- create assembly proxy code for Test Dept. function switches
.SH SYNOPSIS
.B sym2asm
.I sutobj
.I mainobj
.I compiler
.RI [ nm(1)\ binary ]
.br
.SH DESCRIPTION
.\" Add any additional description here
Create assembly proxy code for Test Dept. function switches using
supplied awk-program compiler.  Output will be written to standard
output.

The point is that all foreign symbols from the
.I mainobj
file that access the
.I sutobj
file instead reference proxy functions when a resulting test suite
binary is constructed.  This behavior is ensured by the Test
Dept. framework.

For example, if the
.I sutobj
file contains a symbol
.BR foo ,
then the resulting binary will later instead refer to a symbol
.BR foo_test_dept_proxy .

The
.B sym2asm
command creates such proxy functions for later reference.  The created
proxy is capable of switching between indirecting the original
.B foo
function and a user function selectable by a runtime
switch_function(3) function.

.SS
Arguments
.TP
.I sutobj
An object file containing a Test Dept. object file under test.
.TP
.I mainobj
An object file containing a corresponding test suite accessing the
.IR sutobj .
.TP
.I compiler
An awk(1) program able to compile Test Dept. conformant symbol tables
into assembly code.
.TP
.I nm(1) binary
A path to the nm(1) binary tu use when extracting symbols from the
supplied object files.  If no such binary is provided the default
nm(1) from PATH will be used.

.SH AUTHOR
M Norrby <norrby+test-dept@lysator.liu.se>

.SH EXAMPLES
.nf
sym2asm foo.o foo_test_main.o sym2asm_i686.awk >foo_proxies.s
.fi

.SH SEE ALSO
.IR build_main_from_symbols (1),
.IR sym2repl (1),
.IR test_dept (1),
.IR test-dept (3).
